import style from "./header.module.scss";
import {back_icon} from "../../common/icon/svg";
// const props = {
//     history:null,
//     title:"",
//     path:"",
//     btn: <tag></tag> | true | false
// }

const header = (props)=>{  
 return (
    <div className={style["header"]}>
        {
            props.btn ? props.btn
            : ( 
                <button className={style["goback-btn"]} onClick={()=>{
                    if(props.path) props.history.push(props.path);
                    else props.history.go(-1);
                }}>{back_icon}</button>
            )
        }
        {
            props.title?<p className = {style["title"]}>{props.title}</p>:null
        }
        
    </div>
 )
}

export default header